﻿using System;

namespace Microsoft.Popfly.GameCreator.GameEngine.Test
{
    /// <summary>
    /// Removes all randomness.  Useful for testing the game engine.
    /// </summary>
    public class NonRandom : Random
    {
        public override double NextDouble()
        {
            return 0.5;
        }

        public override void NextBytes(byte[] buffer)
        {
            throw new NotImplementedException("If we want to test a non-random version of NextBytes, we'll have to implement it first.");
        }

        public override int Next()
        {
            return 42;
        }

        public override int Next(int maxValue)
        {
            return maxValue / 2;
        }

        public override int Next(int minValue, int maxValue)
        {
            return (minValue + maxValue) / 2;
        }
    }
}
